<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>贪吃蛇游戏</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="game-container">
        <canvas id="gameCanvas" width="800" height="600"></canvas>
        
        <div class="controls">
            <div class="score-container">
                <span id="score">分数：0</span>
                <span id="highScore">最高分：0</span>
            </div>
            
            <div class="speed-control">
                <label for="speed">速度：</label>
                <input type="range" id="speed" min="1" max="10" value="5">
                <span id="speedValue">5</span>
            </div>
            
            <div class="buttons">
                <button id="startBtn">开始游戏</button>
                <button id="restartBtn">重新开始</button>
            </div>
        </div>

        <div class="game-instructions">
            <h2>游戏说明</h2>
            <ul>
                <li>使用方向键控制蛇的移动方向</li>
                <li>吃到食物可以增加分数和蛇的长度</li>
                <li>撞到墙壁或自己会导致游戏结束</li>
                <li>使用速度滑块调整蛇的移动速度</li>
            </ul>
        </div>
    </div>
    <script src="script.js"></script>
</body>
</html>